package club.gskj.gulimall.product.service;

import club.gskj.gulimall.product.entity.SpuInfoEntity;
import club.gskj.gulimall.product.vo.SkuItemVo;
import com.baomidou.mybatisplus.extension.service.IService;
import club.gskj.common.utils.PageUtils;
import club.gskj.gulimall.product.entity.SkuInfoEntity;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * sku信息
 *
 * @author 康纳-connor
 * @email 2417039231@gmail.com
 * @date 2020-12-27 15:07:43
 */
public interface SkuInfoService extends IService<SkuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveSkuInfo(SkuInfoEntity skuInfoEntity);

    /**
     * 根据检索条件查询
     *
     * @param params
     * @return
     */
    PageUtils queryPageByCondition(Map<String, Object> params);

    /***
     *  根据spu对应的所有sku信息
     * @param spuId
     * @return
     */
    List<SkuInfoEntity> listSkuBySpuId(Long spuId);

    /**
     * 根据 skuId 查询sku信息
     *
     * @param skuId
     * @return
     */
    SkuItemVo item(Long skuId) throws ExecutionException, InterruptedException;

    /***
     *  根据skuId  获取对应的 spu信息
     * @param skuId
     */
    SpuInfoEntity getSpuInfoBySkuId(Long skuId);
}

